/*
 * Copyright 2010 Chad Retz
 * 
 * Licensed under the Apache License, Version 2.0 (the "License"); you may not
 * use this file except in compliance with the License. You may obtain a copy of
 * the License at
 * 
 * http://www.apache.org/licenses/LICENSE-2.0
 * 
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
 * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
 * License for the specific language governing permissions and limitations under
 * the License.
 */
package org.jdocng.shared.model;

import javax.xml.bind.annotation.XmlType;

import com.google.common.annotations.GwtCompatible;
import com.google.gson.annotations.Expose;
import com.sun.javadoc.Tag;

/**
 * Implementation of {@link Tag}
 *
 * @author Chad Retz
 */
@XmlType(name = "tag")
@GwtCompatible(serializable = true)
@SuppressWarnings("serial")
public class TagImpl extends JavadocNgEntity implements Tag {

    //exposed fields
    
    @Expose
    private TagImpl[] firstSentenceTags;
    
    @Expose
    private TagImpl[] inlineTags;
    
    @Expose
    private String kind;
    
    @Expose
    private String name;
    
    @Expose
    private SourcePositionImpl position;
    
    @Expose
    private String text;
    
    //Tag interface impl
    
    @Override
    public TagImpl[] firstSentenceTags() {
        return firstSentenceTags;
    }
    
    @Override
    public DocImpl holder() {
        throw new UnsupportedOperationException("Not yet, still thinkin");
    }
    
    @Override
    public TagImpl[] inlineTags() {
        return inlineTags;
    }
    
    @Override
    public String kind() {
        return kind;
    }
    
    @Override
    public String name() {
        return name;
    }
    
    @Override
    public SourcePositionImpl position() {
        return position;
    }
    
    @Override
    public String text() {
        return text;
    }
    
    @Override
    public String toString() {
        throw new UnsupportedOperationException("Still learning about this");
    }
    
    //other accessors
    
    public void setFirstSentenceTags(TagImpl[] firstSentenceTags) {
        this.firstSentenceTags = firstSentenceTags;
    }
    
    public void setInlineTags(TagImpl[] inlineTags) {
        this.inlineTags = inlineTags;
    }
    
    public void setKind(String kind) {
        this.kind = kind;
    }
    
    public void setName(String name) {
        this.name = name;
    }
    
    public void setPosition(SourcePositionImpl position) {
        this.position = position;
    }
    
    public void setText(String text) {
        this.text = text;
    }
}
